Webhooks allow you to configure one or more merchant specific URLs to be hit by the Payment Broker and will be consumed by a merchant's custom service.
The Webhooks are processed by posting a Base64 encoded JSON payload to the configured URL as defined in the Webhooks template field.
The Webhooks URLs are processed after a successful or failed payment on the Payment Gateway.
The template will contain the post–back fields from the Payment Gateway (for further detail see Step 5 in the Merchant Interface Payments Page v2.1 specification).
These post–back fields in the template are parametrised by enclosing them in hashes (#), and would allow your end–point to be notified so you could update the order status with the outcome of the payment.
The Webhook list in the payment payload can contain the following list of objects.
These requests will be sent on success or failure of the payment, the status can be added to the webhook template if needed.
The following table and figure are an example, of what you could specify in your Create template definition, together with a list of the minimum recommended fields**:
Field Name | Type (max length) |
Required MandatoryOptional |
Description |
---|---|---|---|
Template ^ | String | M | The template of the payload being sent back to the merchant, please see "Create Webhook Template" for details. |
Type | String[5] | M | Standard Rest Types. POST, GET, PUT, DELETE |
URL ^ | String | M | The URL to request will be sent to. |
ContentType | String[ | O | The content type of the request back to the merchant. Default: application/json |